<?php session_start();

if(isset($_SESSION['user'])){
	$year=$_POST['sltYr'];
$subgr=$_POST['sltSubgr'];
$user=$_SESSION['user'];
    
 include'../admin/logic/Classes/db.php'; 

        $x=new Dbconnect();
	
	    $con=$x->getConnection();
		
 //getting emplyee or registration number using User name
$result3=mysql_query("select emp_reg from login where u_name='$user'",$con);
		
while($row3=mysql_fetch_array($result3)){
$emp_reg=$row3['emp_reg'];
}
		 
//getting student name using Registration number
		 
$result2=mysql_query("select reg_no from student where reg_no='$emp_reg'",$con);
		 
while($row2=mysql_fetch_array($result2)){
$reg=$row2['reg_no'];
}
		 

			include'../admin/logic/Classes/examHandler.php';  
			
			
			$x=NULL;
			$z=NULL;
			$w=NULL;
			
			$xm=new ExamHandler();
			$xm->setCon($con);
			
			$result1=$xm->getSubjectProgress($reg,$subgr,$year);
            $result2=$xm->getSubjectProgress($reg,$subgr,$year);
			$result3=$xm->getSubjectProgress($reg,$subgr,$year);
			$result4=$xm->getSubjectProgress($reg,$subgr,$year);
			$num=mysql_num_rows($result1);
			$count=mysql_num_rows($result1);
			?>
 
 <?php if(!($num==0)){  ?>
<script>
document.location="http://chart.apis.google.com/chart?chs=750x400&cht=lc&chd=t:<?php while($row=mysql_fetch_array($result2)){$x=$x+1;$y=$row['marks'];echo $y;if($x<$count){echo",";}}?>&chxt=x,y&chxl=0:|<?php while($row1=mysql_fetch_array($result3)){ $z=$z+1;echo $row1['month'];if($z<$count){ echo"|";} } ?>&chco=3072F3&chtt=Student+Marks";</script>
</body>

 </html>
 <?php 
			
			 }else{ ?> <div align="center"> <strong> There is no record to display. </strong></div><?php } ?>
	  
 <?php }  
else 
{
	header("location:../../index.php");
	}
?>
